import { request } from '@/utils/request'
import type { Patient } from '@/types/user'
// 登录api
export const getLogin = <T>(data: object) => {
  return request<T>('/login/password', 'POST', data)
}

// 获取个人信息
export const getUserInfo = <T>() => request<T>('/patient/myUser')

// 获取患者信息
export const getPatientList = <T>() => request<T>('/patient/mylist')

// 添加患者信息
export const addPatien = <T>(patient: Object) => {
  return request<T>('/patient/add', 'post', patient)
}
// 编辑患者信息
export const editPatient = (patient: Patient) => request('/patient/update', 'PUT', patient)

// 删除患者信息
export const delPatient = (id?: string) => request(`/patient/del/${id}`, 'DELETE')

//根据id获取患者信息
export const getPatientDetial = <T>(id?: string) => request<T>(`/patient/info/${id}`)
